#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include <QDateTime>
#include "rosnode.h"
#include "imageshow.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(int argc, char **argv, QWidget *parent = nullptr);
    ~MainWindow();
    void ReadSettings(); // Load up qt program settings at startup
    void WriteSettings(); // Save qt program settings when closing
    void showNoMasterMessage();

protected:
    void closeEvent(QCloseEvent *event);

Q_SIGNALS:
    void signalRosShutdown();
    void signalRosActionTrigger();

public Q_SLOTS:
    void slotMatUpdate(const cv::Mat &);
    void slotLogViewUpdate();
    void slotRosTriggerUiUpdate();

private slots:
    void handleTimeOut();

    void on_button_connect_clicked();

    void on_button_quit_clicked();

    void on_button_break_clicked();

    void on_action_takeoff_triggered();

    void on_action_land_triggered();

    void on_checkBox_use_default_param_stateChanged(int arg1);

    void on_button_Throw_clicked();

    void on_button_openView_clicked();

    void on_button_startTime_clicked();

    void on_button_sendScanArea_clicked();

    void on_button_sendPathPoint_clicked();

    void on_button_sendPickupPoint_clicked();

    void on_button_sendCmd_clicked();

    void on_button_sendAll_clicked();

private:
    Ui::MainWindow *ui;
    ImageShow imageShow;
    RosNode qRosNode;
    bool bControlBtnState[6];
    QTimer timer;
};

#endif // MAINWINDOW_H
